<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class NoticeAddToUserId extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::table('notices', function (Blueprint $table) {
            $table->bigInteger('to_user_id')->default(0)->index()->comment('接收用户ID，为0则发送给全部用户');
            $table->bigInteger('template_id')->default(0)->index()->comment('消息模板ID');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::table('notices', function (Blueprint $table) {
            $table->dropColumn(['to_user_id', 'template_id']);
        });
    }
}
